package simpledateformat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请您输入您的出生日期(yyyy-MM-dd  HH:mm:ss):");
        String strDate = sc.nextLine();


        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date birthDate = sdf.parse(strDate);
        
        long birthTime = birthDate.getTime();
        long now = System.currentTimeMillis();
        
        long day = (now - birthTime) / (1000 * 60 * 60 * 24);
        System.out.println("day = " + day);
        


    }
}
